package com.naiterui.ehp.ps.push.utils;

import java.util.Arrays;

import lombok.Getter;

/**
 * @author gaoliangliang
 * @date 2020/1/11 5:05 下午
 * @since 1.0.0
 */
@Getter
public enum RegisterEnum {

    NEW_PATIENT(1, 1, "newPatient", "d"),
    NOTICE_INFO(1, 2, "noticeInfo", "d"),
    DYNAMIC_INFO(1, 3, "dynamicInfo", "d"),
    FINISH_DR_SESSION(1, 4, "finishDrSession", "d"),
    ANSWER_REQUIRE(1, 5, "answerRequire", "d"),
    RESERVATION_REMIND(1, 6, "reservationRemind", "d"),
    LEGAL_STATUS(1, 7, "legalStatus", "d"),
    LOG_UPLOAD(1, 8, "logUpload", "d"),
    EDU_READ(1, 9, "eduRead", "d"),
    NEW_REQUIRE(1, 11, "newRequire", "d"),
    FINISH_PT_SESSION(1, 4, "finishPtSession", "p"),
    NEW_DOCTOR(1, 5, "newDoctor", "p"),
    PT_DYNAMIC_INFO(1, 3, "ptDynamicInfo", "p"),
    VIDEO_CONSULT(1, 12, "videoConsult", "d"),
    VIDEO_CONSULT_DR_IMAGE(1, 13, "videoConsultDrImage", "d"),
    VIDEO_CONSULT_PT_IMAGE(1, 13, "videoConsultPtImage", "p"),
    ;

    private int client;
    private int type;
    private String requestUrl;
    private String userType;

    RegisterEnum(int client, int type, String requestUrl, String userType) {
        this.client = client;
        this.type = type;
        this.requestUrl = requestUrl;
        this.userType = userType;
    }

    public static RegisterEnum byRequestUrl(String requestUrl) {
        return Arrays.stream(RegisterEnum.values()).filter(o -> o.getRequestUrl().equalsIgnoreCase(requestUrl)).findFirst().orElse(null);
    }
}
